using System;
using System.Collections.Generic;
using System.Text;
using CodePlex.Resourceful;
using CodePlex.Resourceful.Amazon.S3;

namespace CodePlex.SpaceBlock
{


    public interface ISupportsCheckAction
    {

        bool AllowNewFolder(Path folder);
        bool AllowDeleteFolder(Path folder);
        
    
    }


    public interface IFileSystem
    {
        // misc
        Tracer Tracer { get; }
        string Caption { get;}
        string ShortCaption { get; }

       


        // path manip - non-destructive
        bool Exists(Path path);
        ReadOnlyList<IPathItem> GetItems(Path path);
        ReadOnlyList<IFolderItem> GetFolders(Path path);
        ReadOnlyList<IFileItem> GetFiles(Path path);
        IPathItem GetItem(Path path);

        // path manip - destructive
        void EnsureFolderExists(Path path);
        void EnsureFileExists(Path path);
        void Delete(Path path);

        // metadata
        Metadata GetMetadata(Path path);

        // basic transfer
        void Transfer(IFileItem source, Path destination, Action<long> bytesTransferred);

        
        
    }

    public interface ISupportsMove
    {
        // move
        void Move(Path source, Path destination);
    }
    public interface ISupportsTransferWithMetadata
    {
        // transfer with metadata
        void Transfer(IFileItem source, Path destination, NameValuePairs metadata, Action<long> bytesTransferred);
    }


    public interface ISupportsACL
    {
        // acl 
        ACL GetACL(Path path);
        void SetACL(Path path, ACL acl);
        ReadOnlyList<ACLPrincipal> GetPrincipals();
        ReadOnlyList<string> GetPermissions();
    }



    public interface IPathItem
    {
        IFileSystem FileSystem { get; }
        Path Path { get; }
        DateTime? LastModified { get; }
    }

    public interface IFolderItem : IPathItem
    {
        
    }

    public interface IFileItem : IPathItem
    {
        long Size { get; }
        System.IO.Stream GetInputStream();
    }

    public interface ISupportsQuickMD5
    {
        byte[] QuickMD5 { get; }
    }

    public interface ISupportsFileSystem
    {
        IFileSystem FileSystem { get; }
    }


}
